<?php
session_start();
require_once "../../../global.php";//$dirname."/".
require_once RootDir."/"."inc/config.php";
require_once RootDir."/"."inc/Function.Libary.php";
require_once RootDir."/"."inc/Uifunction.php";
require_once RootDir."/".$SystemConest[1]."/UIFunction/adminClass.php";
require_once RootDir."/".$SystemConest[1]."/system/Config.php";
require_once RootDir."/".$SystemConest[1]."/system/menusys/function.php";
require_once RootDir."/".$SystemConest[1]."/system/classsys/function.php";
$mydb=new YYBDB();
$TableName=$mydb->getTableName($MenuId);
CheckRule($MenuId,$mydb,$TableName,"Add");//检查登陆权限
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加产品</title>
<link href="../../Inc/Css.css" rel="stylesheet" type="text/css">
</head>

<body>
<?
$myClass=new ADMINClass();
$PMID = $_REQUEST["PMID"];
$OwerID=$_REQUEST["OwerID"];

if(strlen($MenuId)<1)
{
	$MenuId=-1;
}

echo CurrPosition((int)($MenuId),$mydb);

//权限控制
CheckRule($MenuId,$mydb,$TableName,"Add");//检查登陆权限


$FormConfig1=GetFormConfig($mydb,$MenuId);
if(is_null($FormConfig1)) die;


$ArrFormConfig=explode(",",$FormConfig1);
//暂时不启用字段的排序
//$FieldsPaixuArr=getFieldsPaixuArr($mydb,$MenuId);
//$ArrFormConfig=getArrpaixu($ArrFormConfig,$FieldsPaixuArr,1);

//显示表单
?>
<form  id="MyForm" name="MyForm" action="Sys_Add_Save.php?MenuId=<? echo $_REQUEST["MenuId"];?>&CMID=<? echo $_REQUEST["CMID"];?>&PMID=<? echo $_REQUEST["PMID"]?>&OwerID=<? echo $_REQUEST["OwerID"];?>" method="post">
	<table width="95%" align=center>
	<Tr><Td class="TdLine"><? echo $_REQUEST["Title"];?></Td></Tr>
	</table>
	<table width="95%" align=center cellspacing=3 class="TableLine">
	
	  <? 
	
	 $i=0;
	// $FieldsPaixuArr=getFieldsPaixuArr($mydb,$MenuId);
	// $ArrFormConfig=getArrpaixu($ArrFormConfig,$FieldsPaixuArr,1);
	
	  foreach($ArrFormConfig as $FormConfig)
	  {
			$FormConfig_arr=explode("|",$FormConfig);

			if($FormConfig_arr[1]<>"7")
			{	
				
				if($FormConfig_arr[1]<>"11")
				{
					
					if($FormConfig_arr[1]=="14")
					{
						
						CreateField($FormConfig,$mydb,"FieldName_" .$i,$i,$_REQUEST["OwerID"],159,737,"TdLine","InputNone");
					}
					else
					{
						CreateField($FormConfig,$mydb,"FieldName_" .$i,$i,"",159,737,"TdLine","InputNone");
					}
					
				}
				else
				{
					
					
						CreateField($FormConfig,$mydb,"FieldName_" . $i,$i,"",159,737,"TdLine","InputNone");
					
					
				}
				
			}
			else
			{
				
				CreateField($FormConfig,$mydb,"FieldName_".$i,$i,$FormConfig_arr[5],159,737,"TdLine","InputNone");
			}
			$i=$i+1;
	  }

	  ?>
	  
	</table>
    <label>
    <div align="center"><br>
      <input type="submit" name="Submit2" value=" 保存 "   onClick="return CheckForm()" id="Submit2">
      <input type="button" name="Submit3" value=" 取消 " onClick="javascript:window.history.back();">
  </div>
    </label>
</form>


</body>
</html>
<?
 Form_check();
 CheckForm($FormConfig1);
 require_once RootDir."/"."inc/Calendar.php";
?>
